<include file="nav:headr"/>
<script src="__upFile__/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__upFile__/uploadify.css"/>
<div class="container">
    <div class="row">
        <div style="height: 30px"></div>
        <div class="col-md-2">
            <include file="Content:sider"/>
        </div>
        <div class="col-md-10">
            <div class="page-header">
                <h4>{$page_title}</h4>
            </div>
            <div class="btn-group" role="group" aria-label="...">
                <a  href="{:U('Article/index')}" type="button" class="btn btn-default">بارلىق يازما</a>
                <a href="{:U('Article/add')}" type="button" class="btn btn-default">يېڭىدىن قوشۇش</a>
            </div>
            <br><br>
            <form action="{:U('Article/savehend')}" method="post">
                <div class="row">
                <div class="col-md-8">
                    <input type="hidden" name="aid" value="{$pags['aid']}">
                        <div class="form-group">
                            <select class="form-control" name="category_cid">
                                <option value="">تۈر تاللاڭ</option>
                                <foreach name="categorys" item="c">
                                    <option value="{$c['cid']}" <if condition="$pags['category_cid'] eq $c['cid']">selected</if>>
                                        <if condition="$c['pid'] neq 0"><?php echo str_repeat('&nbsp;',$c['level']*10);?>┘─&nbsp;</if>
                                        {$c['cname']}
                                    </option>
                                </foreach>
                            </select>
                        </div>
                        <div class="form-group">
                            <input name="title" type="text" class="form-control" placeholder="يازما نامى" value="{$pags['title']}" />
                        </div>
                        <div class="form-group">
                            <textarea name="summer" class="form-control" rows="4" placeholder="ئۈزۈندە:" >{$pags['summer']}</textarea>
                        </div>
                        <div class="form-group">
                            <include file="Editor"/>
                            <textarea type="text/plain" style="min-height: 350px" id="content" name="content">{$pags['content']}</textarea>
                        </div>
                    <div class="form-group">
                        <input name="asort" type="number" class="form-control" placeholder="تەرتىپ" value="{$pags['asort']}" />
                    </div>
                        <div class="form-group">
                            <label class="radio-inline">
                                <input type="radio" name="status" id="inlineRadio1" value="1" <if condition="$pags['status']">checked</if> > ئوچۇق
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="status" id="inlineRadio2" value="0" <if condition="!$pags['status']">checked</if>> تاقاق
                            </label>
                        </div>
                        <div class="form-group">
                            <input name="author" type="text" class="form-control" placeholder="ئاپتور" value="{$pags['author']}">
                        </div>
                        <button type="submit" class="btn btn-primary">ساقلاش</button>
                </div>
                <div class="col-md-4">
                    <div class="panel panel-default">
                        <div class="panel-heading">يازما مۇقاۋا رەسىمى</div>
                        <div class="panel-body">
                            <form>
                                <input id="thumbin" name="thumb" class="form-control " value="{$pags['thumb']}"/>
                                <br>
                                <input type="file" name="upload"  id="file"  />
                                <img src="__UPLOADs__/{$pags['thumb']}" id="thumbimg" />
                            </form>
                            <script type="text/javascript">
                                $(function() {
                                    $('#file').uploadify({
                                        'swf'      : '__upFile__/uploadify.swf',
                                        'uploader' : "{:U('Article/uploadThumb')}",
                                        'buttonText':'مۇقاۋا رەسىمى تاللاڭ',
                                        'onUploadSuccess':function (file,data) {
                                            data=$.parseJSON(data);
                                            $('#thumbin').val(data);
                                            $('#thumbimg').attr('src','__UPLOADs__/'+data);
                                        }
                                    });
                                });
                            </script>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">يازما تەۋسىيەلەش</h3>
                        </div>
                        <div class="panel-body">
                            <foreach name="tags" item="t">
                               <label style="margin-right: 0" class="checkbox-inline">
                                   <input type="checkbox" name="tag[]" <if condition="in_array($t['tid'],$page_tags)">checked</if>  value="{$t['tid']}">{$t['tname']}
                               </label>
                            </foreach>
                        </div>
                    </div>
               </div>
         </div>
            </form>
        </div>
    </div>
</div>
<div style="height: 400px"></div>

<include file="nav:footer" />